
import com.anhdt.model.Categories;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.LoggerFactory;

public class CateDetail extends BaseService {

    private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(CateDetail.class);

    @Override
    public void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException, SQLException {
        response.setContentType("application/json;charset=UTF-8");
        try (PrintWriter out = response.getWriter()) {
            Categories cate = Categories.getInstance();
            int id = Integer.parseInt(request.getParameter("id"));
            out.println(this.ResponseJSon(cate.getCateDetail(id)));
        }
    }

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {
            exeMethod(request, response);
    }

    protected void show(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, SQLException {
        response.setContentType("text/html;charset=UTF-8");
        try (PrintWriter out = response.getWriter()) {
            out.println("hello!");
        }
    }
    
}
